#include "GfxD3D9.h"

namespace imGraphics {
	D3DVERTEXELEMENT9 declVertex[4] = {
		{ 0, 0,  D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
		{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL,   0 },
		{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },
		D3DDECL_END()
	};

	HRESULT CreateRenderDevice(HINSTANCE hDLL, iRenderer **pRenderer) {
		if(!*pRenderer) {
			*pRenderer = new D3D9Renderer();
			return S_OK;
		};
		return E_FAIL;
	}

	HRESULT ReleaseRenderDevice(iRenderer **pRenderer) {
		if(!*pRenderer) {
			return E_FAIL;
		};
		delete *pRenderer;
		*pRenderer = NULL;
		return S_OK;
	}
}